package com.lbssoft.gpsbd.model;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;

public class SocketMsg {
	private String type;
	private Collection<?> data;
	public SocketMsg() {
		super();
	}
	public SocketMsg(String type,Collection<?> data){
		this.type =type;
		this.data = data;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Collection<?> getData() {
		return data;
	}
	public void setData(Collection<?> data) {
		this.data = data;
	}

	public String toJSONString() {
		Map<String, Collection<?>> map = new HashMap<String, Collection<?>>();
		map.put(this.type, this.data);
		return JSONObject.toJSONString(map);
	}

}


